const { mix } = require('laravel-mix');
const {Building} = require('./webpack.whenBuild')

// 错误异常
try{
    new Building()
}catch(e){
    console.log(e)
}

mix.webpackConfig({
    module: {
        rules: [
            {
                test: /\.css$/,
                loader: "style-loader!css-loader"
            },
        ]
    }
});


/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */
/*
mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css');
*/

// |-------------------------------------- [index]
    // 首页 2017年7月15日 星期六
    mix.js('resources/assets/js/index/home.js', 'public/js/index/')
        .sass('resources/assets/sass/index/home.scss', 'public/css/index/')
        //.extract(['vue'])
    ;
    // 错误提示页面
    mix.js('resources/assets/js/index/error.js', 'public/js/index/')
    ;
    // 日志系统单页面界面
    mix.js('resources/assets/js/index/mylog.js', 'public/js/index/')
        .sass('resources/assets/sass/index/mylog.scss', 'public/css/index/')
    ;


// |-------------------------------------- [fiannce]   
    // 财务登账 2017年7月15日 星期六
    mix.js('resources/assets/js/finance/account.js', 'public/js/finance/')
        .sass('resources/assets/sass/finance/account.scss', 'public/css/finance/')
        //.extract(['vue'])
    ;
    // 财务计划 2017年8月18日 星期五
    mix.js('resources/assets/js/finance/plan.js', 'public/js/finance/')
        .sass('resources/assets/sass/finance/plan.scss', 'public/css/finance/')
        //.extract(['vue'])
    ;
    // 事务甲乙 2017年8月18日 星期五
    mix.js('resources/assets/js/finance/affair.js', 'public/js/finance/')
        .sass('resources/assets/sass/finance/affair.scss', 'public/css/finance/')
        //.extract(['vue'])
    ;
   